﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using DataForest.Utilities;
using DataForest.ViewModel.Dialogs;

namespace DataForest.ViewModel
{
    class StartTabViewModel : TabModel
    {
        public StartTabViewModel()
            : base(null)
        {}


        private RelayCommand showIntroCommand;
        private RelayCommand showTreeCommand;
        private RelayCommand showTableCommand;
        private RelayCommand showRulesCommand;

        public ICommand ShowIntroCommand
        {
            get
            {
                if (showIntroCommand == null)
                {
                    showIntroCommand = new RelayCommand(param => ShowManual(ManualModel.Part.INTRO));
                }
                return showIntroCommand;
            }
        }
        public ICommand ShowTreeCommand
        {
            get
            {
                if (showTreeCommand == null)
                {
                    showTreeCommand = new RelayCommand(param => ShowManual(ManualModel.Part.TREE));
                }
                return showTreeCommand;
            }
        }
        
        public ICommand ShowTableCommand
        {
            get
            {
                if (showTableCommand == null)
                {
                    showTableCommand = new RelayCommand(param => ShowManual(ManualModel.Part.TABLE));
                }
                return showTableCommand;
            }
        }
        
        public ICommand ShowRulesCommand
        {
            get
            {
                if (showRulesCommand == null)
                {
                    showRulesCommand = new RelayCommand(param => ShowManual(ManualModel.Part.RULES));
                }
                return showRulesCommand;
            }
        }

        private void ShowManual(ManualModel.Part part) {
            ManualModel model = new ManualModel();
            model.SelectedPart = part;
            MyDialogService.ShowDialog(model);
        }

    }
}
